<admintpl file="header" />
<style>
.well{font-size:12px;}
select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input{
padding:0px;
}
.table>thead>tr>th{border-bottom:none;}
.table>thead>tr{background-color:#ecf0f1;}
</style>
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="javascript:;">首页轮播管理</a></li>
		</ul>
		<div style="width:100%;height:40px;">
			<a href="?g=Admin&m=IndexSlidesys&a=add" class="btn btn-primary">添加轮播图</a>
		</div>
		 
		<form class="js-ajax-form" action="" method="post">
			<div class="table-actions">
				<button class="btn btn-danger btn-small js-ajax-submit" type="submit" data-action="/index.php?g=Admin&m=Homesys&a=slider_gdelete" data-subcheck="true" data-msg="您确定删除吗？">删除</button>
			</div>
			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>
						<th width="15"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
						<th width="50"><a href="admin.php?g=Admin&m=IndexSlidesys&a=index&orderby=id&orrule={$postData['idDesc']}">ID</a></th>
						<th width="60">封面图片</th>
						<th width="60">长图图片</th>
						<th width="50">外链</th>
						<th width="50">排序</th>
						<th width="50">创建时间</th>
						<th width="70">操作</th>
					</tr>
				</thead>
				<foreach name="queryData" item="data">
				<tr>
						<td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$slide['id']}" title="ID:{$slide['id']}"></td>
						<td><b>{$data['id']}</b></td>
						<td><b><img width="100" src="./data/upload/{$data['pic']}" /></b></td>
						<td><if condition="$data['bigtu'] neq '' "><b><img width="100" src="./data/upload/{$data['bigtu']}" /></b></if></td>
						<td><b>{$data['link']}</b></td>
						<td><b>{$data['hot']}</b></td>
						<td><b>{$data['createtime']}</b></td>
						<td>
							<a href="admin.php?g=Admin&m=IndexSlidesys&a=edit&id={$data['id']}">编辑</a> | 
							<a href="admin.php?g=Admin&m=IndexSlidesys&a=delete&id={$data['id']}" class="js-ajax-delete">删除</a>
						</td>
				</tr>
				</foreach>			
			</table>
			<div class="table-actions">
				<button class="btn btn-danger btn-small js-ajax-submit" type="submit" data-action="/index.php?g=&m=AdminPost&a=delete" data-subcheck="true" data-msg="您确定删除吗？">删除</button>
			</div>
			<div class="pagination">{$page}</div>
		</form>
		<br />
		<p style="font-size:12px;">轮播图片尺寸 (1024 * 708px) 长宽</p>
	</div>
	<script src="public/js/common.js"></script>
	<script>
		function refersh_window() {
			var refersh_time = getCookie('refersh_time');
			if (refersh_time == 1) {
				window.location = "/index.php?g=&m=AdminPost&a=index";
			}
		}
		setInterval(function() {
			refersh_window();
		}, 2000);
		$(function() {
			setCookie("refersh_time", 0);
			Wind.use('ajaxForm', 'artDialog', 'iframeTools', function() {
				//批量复制
				$('.js-articles-copy').click(function(e) {
					var ids=[];
					$("input[name='ids[]']").each(function() {
						if ($(this).is(':checked')) {
							ids.push($(this).val());
						}
					});
					
					if (ids.length == 0) {
						art.dialog.through({
							id : 'error',
							icon : 'error',
							content : '您没有勾选信息，无法进行操作！',
							cancelVal : '关闭',
							cancel : true
						});
						return false;
					}
					
					ids= ids.join(',');
					art.dialog.open("/index.php?g=portal&m=AdminPost&a=copy&ids="+ ids, {
						title : "批量复制",
						width : "300px"
					});
				});
				//批量移动
				$('.js-articles-move').click(function(e) {
					var ids=[];
					$("input[name='ids[]']").each(function() {
						if ($(this).is(':checked')) {
							ids.push($(this).val());
						}
					});
					
					if (ids.length == 0) {
						art.dialog.through({
							id : 'error',
							icon : 'error',
							content : '您没有勾选信息，无法进行操作！',
							cancelVal : '关闭',
							cancel : true
						});
						return false;
					}
					
					ids= ids.join(',');
					art.dialog.open("/index.php?g=portal&m=AdminPost&a=move&old_term_id=0&ids="+ ids, {
						title : "批量移动",
						width : "300px"
					});
				});
			});
		});
	</script>
</body>
</html>